using System;
using System.Collections;
using System.Collections.Generic;

using Sinacor.Servico.Bovespa.Cliente.Service.DataContract.Response;
using Sinacor.Servico.Bovespa.Cliente.BusinessEntity;

namespace Sinacor.Servico.Bovespa.Cliente.Service.ServiceImplementation.Translator
{
    public static class TranslateCorrespondente
    {
        public static DataContract.Response.CorrespondenteResponse ToCorrespondenteResponse(BusinessEntity.Correspondente from)
        {
            if (from == null) return null;

            CorrespondenteResponse to = new CorrespondenteResponse();

            to.Codigo = from.Codigo;
            to.CodigoMembroBovespa = from.CodigoMembroBovespa;
            to.IndicadorBroker = from.IndicadorBroker;
            to.Nome = from.Nome;
            to.NomeResumidoCorrespondente = from.NomeResumidoCorrespondente;
            to.PercentualComissao = from.PercentualComissao;

            return to;
        }

        public static BusinessEntity.Correspondente ToCorrespondente(DataContract.Request.ConsultarCorrespondenteRequest from)
        {
            if (from == null) return null;

            BusinessEntity.Correspondente to = new BusinessEntity.Correspondente();

            to.Codigo = from.Codigo;

            return to;
        }

    }
}

